import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import "animate.css";
//导入第三方消息组件
import {Alert, Confirm, Toast} from 'wc-messagebox'
import 'wc-messagebox/style.css'
Vue.use(Alert)
Vue.use(Confirm)
Vue.use(Toast)

//图片懒加载
import VueLazyload from 'vue-lazyload';
import loadingImg from "./assets/loadingImg.gif";
import errorImg from "./assets/error.gif";
Vue.use(VueLazyload,{
  error: errorImg,
  loading: loadingImg
});


//导入swiper
import VueAwesomeSwiper from 'vue-awesome-swiper';
import 'swiper/dist/css/swiper.css';
Vue.use(VueAwesomeSwiper);

import viewContent from "./components/viewContent.vue";
Vue.component("viewContent",viewContent);

//导入iconfont.css
import "./assets/css/iconfont.css";

import axios from "axios";
Vue.prototype.$http=axios.create({
  baseURL:"https://www.softeem.xin/maoyanApi"
});

//导入自定义全局组件
import page from "./components/page.vue"
Vue.component("page",page);
Vue.config.productionTip = false

Vue.prototype.showLoading=function(config){
  this.$store.dispatch("showLoading",config);
}
Vue.prototype.hideLoading=function(){
  this.$store.dispatch("hideLoading");
}
Vue.prototype.showActionSheet=function(config){
  this.$store.dispatch("showActionSheet",config);
}
Vue.prototype.hideActionSheet=function(){
  this.$store.dispatch("hideActionSheet");
}
//显示预览图片
Vue.prototype.showPreviewImage=function(config){
  this.$store.dispatch("showPreviewImage",config);
}
new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
